package com.sl.proxy.server.controller;

import cn.hutool.core.util.ObjectUtil;
import com.sl.common.pojo.CommonResult;
import com.sl.proxy.server.base.proxy.ProxyConfig;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: aoshiguchen
 * @date: 2023/4/2
 */
@Slf4j
@RequestMapping("/domain-name")
@RestController
@RequiredArgsConstructor
public class DomainNameController {

    @Autowired(required = false)
    private ProxyConfig proxyConfig;

    @GetMapping("/bind-info")
    public CommonResult<String> bindInfo() {
        return CommonResult.data(proxyConfig.getServer().getTcp().getDomainName());
    }

}
